# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_submodules, collect_data_files

a = Analysis(
    ['run_pyhat_gui.py','D:\myProject\pyhat\pyhat-main\gui\core\MainWindow.py',],
    pathex=['D:\\myProject\\pyhat\\pyhat-main'],
    binaries=[],
    datas=[('gui/images/icon.ico', 'gui/images'),
    ('gui/images/*', 'gui/images'),
    *collect_data_files('spectral'),
    *collect_data_files('pysptools')

],
    hiddenimports=[
        'numpy',
        'scipy',
        'pandas',
        'sklearn',
        'sklearn.gaussian_process',
        'sklearn.kernel_ridge',
        'sklearn.linear_model',
        'sklearn.svm',
        'sklearn.cross_decomposition',
        'sklearn.ensemble',
        'sklearn.preprocessing',
        'sklearn.decomposition',
        'sklearn.cluster',
        'spectral',
        'pysptools',
        'PyQt5',
        'PyQt5.QtWidgets',
        'PyQt5.QtCore',
        'PyQt5.QtGui',
        'matplotlib',
        'matplotlib.backends.backend_qt5agg',
        'pywavelets',
        'networkx',
        'cvxopt',
        'astropy',
        'gdal',
        'pyod',
        'mesma',
        'sphinx',
        'docutils',
        'multipledispatch',
        'yaml',
        'pvl',
        'plio',
        *collect_submodules('libpyhat'),
        *collect_submodules('gui')
        ],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [],
    exclude_binaries=True,
    name='pyhat',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=False,
    icon='gui\\images\\icon.ico',
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
    onefile=True,    # 生成单个EXE文件
)
coll = COLLECT(
    exe,
    a.binaries,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='pyhat',
)
